import 'package:flutter/material.dart';
import 'package:can/classes/app_colors.dart';
import 'package:can/classes/player.dart';

class PlayerInfo extends StatelessWidget {
  final Player player;

  const PlayerInfo({Key? key, required this.player}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Expanded(
      child: Container(
        color: AppColors.mistyWhite,
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: <Widget>[
              Image.asset(
                'assets/images/${player.active ? 'girl-1' : 'boy-5'}.png',
                width: 50,
              ),
              Text(player.name,
                  textAlign: TextAlign.center,
                  style: const TextStyle(
                      color: AppColors.navyBlue,
                      fontWeight: FontWeight.bold,
                      fontSize: 20)),
              Center(
                child: Container(
                  width: 60,
                  height: 30,
                  decoration: BoxDecoration(
                    color: const Color.fromARGB(255, 243, 103, 145),
                    borderRadius: BorderRadius.circular(5),
                  ),
                  child: Center(
                    child: Text(
                      player.points.toString(),
                      style: const TextStyle(
                        color: Colors.white,
                        fontWeight: FontWeight.bold,
                        fontSize: 16,
                      ),
                    ),
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
